07. Lab: Test Your Dog API
Lab: Test Your Dog API
Reuse your Dog REST API code from Lesson 2 and create unit and integration tests for it.
Step 1: Create a unit test for your API using the
@WebMvcTest
annotation.Step 2: Create an integration test for your API using the
@SpringBootTest
annotation.
Test Your Dog API Lab
Task Feedback:
Amazing work! Not only have you implemented crucial testing for your API, but look back at everything you've done in this course - from REST, GraphQL and microservices, to securing, documenting and testing your APIs. Coming up soon is the project, where you'll combine all of your new skills together for a Vehicles API.
We haven't included a solution for this lab due to the many different tests you could possibly add for your API, but make sure to check back in the Case Studies if you need more ideas! You'll also get a chance to get creative in the upcoming project for what tests you want to implement.